import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        try (Writer writer=new FileWriter("d:/test/test.txt",true)){

            //直接写会覆盖之前的内容，但加上append就不会覆盖
            writer.write("我在学习IO");
        }

    }
}
